<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    th {
      position: sticky;
      background-color: black;
      color: white;
      top: 0;
    }
  </style>
</head>

<body>
  <table>
    <thead>
      <tr><th>姓名</th><th>喜欢的颜色</th></tr>
    </thead>
    <tbody>
      <tr>
        <td>小明</td>
        <td>蓝色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
      <tr>
        <td>小红</td>
        <td>紫色</td>
      </tr>
    </tbody>
  </table>
</body>

</html>